<?php

namespace App\Http\Controllers\Api;

use App\Common\Enums\UploadEnum;
use App\Helpers\UploadHelper;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class DogsController extends Controller
{

    function f(Request $request){
        if($request->post()){
            if($request->hasFile('file')&&$request->file('file')->isValid()){
                $upload = new UploadHelper($request->file(), UploadEnum::UPLOAD_TYPE_IMAGES);
                $upload->verifyFile();
                $upload->save();
                die;
            }else{
                return '请上传文件';
            }
        }
        return view('api.test.index');
    }
}
